﻿<%@ Page Title="" Language="C#" MasterPageFile="~/manager.Master" AutoEventWireup="true" CodeBehind="add_bus.aspx.cs" Inherits="Bus_proj.website.add_bus" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/Stylebuttoncss.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/textbox.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style3
        {
            width: 178px;
        }
        .style4
        {
            width: 94px;
        }
        .style5
        {
            width: 81px;
        }
        .style6
        {
            height: 21px;
        }
        .style10
        {
            width: 116px;
        }
        .style11
        {
            width: 144px;
        }
        .style12
        {
            width: 416px;
        }
        .style13
        {
            width: 416px;
            height: 21px;
        }
        .style14
        {
            width: 49px;
        }
        .style15
        {
            width: 247px;
        }
        .style16
        {
            width: 433px;
        }
        .style17
        {
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button8" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button6" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button7" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button8" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button9" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button10" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button11" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button3" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="Button4" EventName="Click" />
    </Triggers>
<fieldset class="el03">
<legend>จัดการรถโดยสาร</legend>
    <table class="style1">
        <tr>
            <td align="right" class="style15">
                <asp:Label ID="Label1" runat="server" Text="หมายเลขรถ :"></asp:Label>
            </td>
            <td class="style3">
                <asp:DropDownList ID="DropDownList4" runat="server" 
                    DataSourceID="LinqDataSource2" DataTextField="Bus_number" 
                    DataValueField="Bus_number" Width="150px" CssClass="textbox">
                </asp:DropDownList>
                <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
                    ContextTypeName="Bus_proj.DataClasses1DataContext" EntityTypeName="" 
                    TableName="Table_Bus">
                </asp:LinqDataSource>
            </td>
            <td align="right" class="style4">
                &nbsp;</td>
            <td class="style5">
                <asp:Button ID="Button1" runat="server" Height="51px" Text="ค้นหา" 
                    Width="109px" onclick="Button1_Click" CssClass="classname" />
            </td>
            <td>
                <asp:Button ID="Button8" runat="server" Height="51px" onclick="Button8_Click" 
                    Text="เพิ่มรถ" Width="109px" CssClass="classname" />
            </td>
        </tr>
    </table>

    <asp:Panel ID="Panel1" runat="server" Visible="False">
    <fieldset class="el02">
        <legend>ข้อมูลรถ</legend>
        <table class="style1">
            <tr>
                <td align="right" class="style12">
                    <asp:Label ID="Label5" runat="server" Text="ป้ายทะเบียน :"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBox1" runat="server" Width="150px" CssClass="textbox"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="style12">
                    <asp:Label ID="Label6" runat="server" Text="จังหวัด :"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="DropDownList3" runat="server" 
                        DataSourceID="LinqDataSource4" DataTextField="ProvinceName" 
                        DataValueField="ProvinceId" Width="150px" CssClass="textbox">
                        <asp:ListItem Selected="True" Value="0">*เลือกจังหวัด</asp:ListItem>
                    </asp:DropDownList>
                    <asp:LinqDataSource ID="LinqDataSource4" runat="server" 
                        ContextTypeName="Bus_proj.DataClasses1DataContext" EntityTypeName="" 
                        TableName="Provinces">
                    </asp:LinqDataSource>
                </td>
            </tr>
            <tr>
                <td align="right" class="style12">
                    <asp:Label ID="Label4" runat="server" Text="ประเภทรถ :"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="DropDownList5" runat="server" 
                        DataSourceID="LinqDataSource3" DataTextField="Type_Bus_name" 
                        DataValueField="Type_Bus_id" Width="150px" CssClass="textbox">
                        <asp:ListItem Value="0">*เลือกประเภทรถ</asp:ListItem>
                    </asp:DropDownList>
                    <asp:LinqDataSource ID="LinqDataSource3" runat="server" 
                        ContextTypeName="Bus_proj.DataClasses1DataContext" EntityTypeName="" 
                        TableName="Table_Type_Bus">
                    </asp:LinqDataSource>
                    <asp:LinkButton ID="LinkButton1" runat="server" 
                        PostBackUrl="~/website/Add_type_bus.aspx">เพิ่มประเภทรถ</asp:LinkButton>
                </td>
            </tr>
            <tr>
                <td align="right" class="style13">
                    <asp:Label ID="Label3" runat="server" Text="หมายเลขเส้นทาง :"></asp:Label>
                </td>
                <td class="style6">
                    <asp:DropDownList ID="DropDownList8" runat="server" 
                        DataSourceID="LinqDataSource1" DataTextField="Route_id" 
                        DataValueField="Route_id" Width="151px" CssClass="textbox">
                    </asp:DropDownList>
                    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                        ContextTypeName="Bus_proj.DataClasses1DataContext" EntityTypeName="" 
                        TableName="Table_Routes">
                    </asp:LinqDataSource>
                </td>
            </tr>
            <tr>
                <td align="right" class="style12">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td align="right" class="style12">
                    &nbsp;</td>
                <td>
                    <asp:Button ID="Button6" runat="server" OnClientClick="return confirm('ยืนยันการเพิ่มรายการ')" Height="51px" Text="เพิ่ม" 
                        Width="109px" onclick="Button6_Click" CssClass="classname" />
                    <asp:Button ID="Button7" runat="server" Height="51px" Text="ยกเลิก" 
                        Width="109px" onclick="Button7_Click" CssClass="classname" />
                </td>
            </tr>
        </table>
       </fieldset>
    </asp:Panel>

    <asp:Panel ID="Panel4" runat="server" Visible="False">
        <fieldset class="el02">
        <legend>แก้ไขข้อมูลรถ</legend>
        <table class="style1">
            <tr>
                <td align="right" class="style16">
                    <asp:Label ID="Label7" runat="server" Text="หมายเลขรถ :"></asp:Label>
                </td>
                <td>
                    <asp:Label ID="Label8" runat="server" Text="Label"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right" class="style16">
                    <asp:Label ID="Label9" runat="server" Text="ประเภทรถ :"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="DropDownList6" runat="server" 
                        DataSourceID="LinqDataSource5" DataTextField="Type_Bus_name" 
                        DataValueField="Type_Bus_id" Width="150px" AutoPostBack="True" 
                        CssClass="textbox">
                    </asp:DropDownList>
                    <asp:LinqDataSource ID="LinqDataSource5" runat="server" 
                        ContextTypeName="Bus_proj.DataClasses1DataContext" EntityTypeName="" 
                        TableName="Table_Type_Bus">
                    </asp:LinqDataSource>
                </td>
            </tr>
            <tr>
                <td align="right" class="style16">
                    <asp:Label ID="Label10" runat="server" Text="ทะเบียนรถ :"></asp:Label>
                </td>
                <td>
                    <asp:TextBox ID="TextBox3" runat="server" Width="150px" CssClass="textbox"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right" class="style16">
                    <asp:Label ID="Label11" runat="server" Text="จังหวัด :"></asp:Label>
                </td>
                <td>
                    <asp:DropDownList ID="DropDownList7" runat="server" 
                        DataSourceID="LinqDataSource6" DataTextField="ProvinceName" 
                        DataValueField="ProvinceId" Width="150px" AutoPostBack="True" 
                        CssClass="textbox">
                    </asp:DropDownList>
                    <asp:LinqDataSource ID="LinqDataSource6" runat="server" 
                        ContextTypeName="Bus_proj.DataClasses1DataContext" EntityTypeName="" 
                        TableName="Provinces">
                    </asp:LinqDataSource>
                </td>
            </tr>
            <tr>
                <td align="right" class="style16">
                    &nbsp;</td>
                <td>
                    <asp:Button ID="Button9" runat="server" OnClientClick="return confirm('ยืนยันการแก้ไขรายการ')" Height="51px" Text="แก้ไข" 
                        Width="109px" onclick="Button9_Click" CssClass="classname" />
                    <asp:Button ID="Button10" runat="server" Height="51px" Text="ยกเลิก" 
                        Width="109px" onclick="Button10_Click" CssClass="classname" />
                </td>
            </tr>
            <tr>
                <td align="right" class="style16">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        </fieldset>
    </asp:Panel>

    <asp:Panel ID="Panel3" runat="server" Visible="False">
    <fieldset class="el02">    
    <legend>ตารางแสดงข้อมูลรถ</legend>
    <table class="style1">
        <tr>
            <td class="style6" align="center">
                <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                    CellPadding="4" ForeColor="Black" GridLines="Vertical" 
                    onrowcommand="GridView1_RowCommand" BackColor="White" 
                    BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" Font-Size="Medium" 
                    Width="597px">
                    <AlternatingRowStyle BackColor="White" />
                    <Columns>
                        <asp:BoundField DataField="Bus_number" HeaderText="หมายเลขรถ" />
                        <asp:BoundField DataField="Bus_licence_plate" HeaderText="เลขทะเบียน" />
                        <asp:BoundField DataField="Province" HeaderText="จังหวัด" />
                        <asp:BoundField DataField="Type_Bus_name" HeaderText="ประเภทรถ" />
                        <asp:BoundField DataField="Bus_status" HeaderText="สถานะรถ" />
                        <asp:TemplateField HeaderText="ลบ">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="return confirm('ยืนยันการลบรายการ')" Height="20px" Width="20px" 
                                            CommandName="cmdY" CommandArgument='<%#Eval("Bus_number") %>' 
                                            ImageUrl="~/Images/delete-icon.png" />
                                    </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">
                        ไม่มีข้อมูลรถ</span>
                    </EmptyDataTemplate>
                    <FooterStyle BackColor="#CCCC99" />
                    <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                    <RowStyle BackColor="#F7F7DE" />
                    <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                    <SortedAscendingCellStyle BackColor="#FBFBF2" />
                    <SortedAscendingHeaderStyle BackColor="#848384" />
                    <SortedDescendingCellStyle BackColor="#EAEAD3" />
                    <SortedDescendingHeaderStyle BackColor="#575357" />
                </asp:GridView>
                </td>
        </tr>
        <tr>
            <td class="style6" align="center">
                &nbsp;</td>
        </tr>
        </table>
    </fieldset>
    </asp:Panel>

    <asp:Panel ID="Panel6" runat="server" Visible="False">
    <fieldset class="el02">    
    <legend>ตารางแสดงรายชื่อพนักงานขับรถ</legend>
        <table class="style1">
            <tr>
                <td align="center" colspan="2">
                    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
                        BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" 
                        CellPadding="4" ForeColor="Black" GridLines="Vertical" 
                        onrowcommand="GridView3_RowCommand" Font-Size="Medium" Width="604px">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="Personnel_id" HeaderText="รหัสพนักงาน" />
                            <asp:BoundField DataField="Personnel_prefix" HeaderText="คำนำหน้า" />
                            <asp:BoundField DataField="Personnel_name" HeaderText="ชื่อ" />
                            <asp:BoundField DataField="Personnel_surname" HeaderText="นามสกุล" />
                            <asp:TemplateField HeaderText="เลือกพนักงานขับรถ">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="ImageButton2" runat="server" OnClientClick="return confirm('ยืนยันการเลือกรายการ')" Height="20px" 
                                            ImageUrl="~/Images/Actions-document-save-as-icon.png" Width="20px" CommandArgument='<%#Eval("Personnel_id") %>' CommandName="cmdY" />
                                    </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataTemplate>
                            <span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">
                            ไม่มี</span>ข้อมูลพนักงานขับรถ
                        </EmptyDataTemplate>
                        <FooterStyle BackColor="#CCCC99" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#FBFBF2" />
                        <SortedAscendingHeaderStyle BackColor="#848384" />
                        <SortedDescendingCellStyle BackColor="#EAEAD3" />
                        <SortedDescendingHeaderStyle BackColor="#575357" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
     </fieldset>   
    </asp:Panel>

    <asp:Panel ID="Panel5" runat="server" Visible="False">
    <fieldset class="el02">    
    <legend>ตารางแสดงพนักงานขับรถ</legend>
        <table class="style1">
            <tr>
                <td class="style17" align="center">
                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" 
                        CellPadding="4" ForeColor="Black" GridLines="Vertical" 
                        onrowcommand="GridView2_RowCommand" BackColor="White" 
                        BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" Font-Size="Medium" 
                        Width="598px">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:BoundField DataField="Bus_number" HeaderText="หมายเลขรถ" />
                            <asp:BoundField DataField="Personnel_prefix" HeaderText="คำนำหน้า" />
                            <asp:BoundField DataField="Personnel_name" HeaderText="ชื่อ" />
                            <asp:BoundField DataField="Personnel_surname" HeaderText="นามสกุล" />
                            <asp:TemplateField HeaderText="ยกเลิก">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="ImageButton3" runat="server" OnClientClick="return confirm('ยืนยันการยกเลิกรายการ')" Height="20px" 
                                            ImageUrl="~/Images/delete-icon.png" Width="20px" CommandArgument='<%#Eval("drive_id") %>' CommandName="cmdY" />
                                    </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataTemplate>
                            <span style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">
                            ไม่มี</span>ข้อมูลพนักงานขับรถ
                        </EmptyDataTemplate>
                        <FooterStyle BackColor="#CCCC99" />
                        <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                        <RowStyle BackColor="#F7F7DE" />
                        <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                        <SortedAscendingCellStyle BackColor="#FBFBF2" />
                        <SortedAscendingHeaderStyle BackColor="#848384" />
                        <SortedDescendingCellStyle BackColor="#EAEAD3" />
                        <SortedDescendingHeaderStyle BackColor="#575357" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td class="style17" align="center">
                    <asp:Button ID="Button11" runat="server" Text="เพิ่มพนักงานขับรถ" 
                        Width="211px" Visible="False" onclick="Button11_Click" Height="51px" 
                        CssClass="classname" />
                </td>
            </tr>
        </table>
        </fieldset> 
    </asp:Panel>

    <asp:Panel ID="Panel2" runat="server" Visible="False">
    <fieldset class="el02">        
    <table class="style1">
    <tr>
        <td align="center" class="style14" >
            &nbsp;</td>
        <td align="center" class="style10" >
            <asp:Button ID="Button3" runat="server" Height="51px" Text="แก้ไขข้อมูล" 
                Width="148px" onclick="Button3_Click" CssClass="classname" />
        </td>
        <td align="center" class="style11" >
            <asp:Button ID="Button4" runat="server" Height="51px" Text="พนักงานขับรถ" 
                Width="162px" onclick="Button4_Click" CssClass="classname" />
        </td>
        <td >
            &nbsp;</td>
    </tr>
    </table>
    </fieldset>
    </asp:Panel>
      
</fieldset>
    </ContentTemplate>
    </asp:UpdatePanel>


</asp:Content>

